<template>
	<view class="page">
		<con-venues :itemChooselist='itemChooselist' :venuelist='venuelist' @confirm="confirm1"></con-venues>
		<view style="position: fixed;z-index: 999;width: 100%;top: 120rpx;">
			<view class="box_11">
				<view class="image-wrapper_7">
					<u-search @search="search" @custom="search" placeholder="搜索" :showAction="false"
						v-model="searchKey">
					</u-search>
				</view>
				<view class="label_list" @click="plbatch" v-if="plshow">
					<image
						src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/0555f554c12d0d628b0e4e3e90147966755aa715.png"
						class="label_7"></image>
					<view class="label_77">
						批量
					</view>
				</view>
				<view class="label_list" @click="plbatch" v-if="!plshow">
					<image
						src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/0555f554c12d0d628b0e4e3e90147966755aa715.png"
						class="label_7"></image>
					<view class="label_77">
						设置
					</view>
				</view>
				<view class="label8_list">
					<image
						src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/a0caafa1d0f5c11490a41f203aab143debf439d6.png"
						class="label_8"></image>
					<view class="label_88">
						<HM-filterDropdown :menuTop="88" :filterData="filterData" :defaultSelected="defaultSelected"
							:updateMenuName="true" @confirm="confirm" dataFormat="Object"></HM-filterDropdown>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="group_3">
			<view class="item">
				<input type="text" placeholder="手机号" class="atinput" />
			</view>
			<view class="item">
				<input type="text" placeholder="会员姓名" class="atinput" />
			</view>
			<view class="item">
				<input type="text" placeholder="卡名称" disabled v-model="userInfo.occupation_relation"
					@click="showoccupation = true" class="atinput" />
			</view>
			<u-picker :show="showoccupation" :columns="occupation_status" keyName="label" @confirm="addoccupation"
				@cancel="showoccupation = false">
			</u-picker>
			<button bindtap="onClick" class="button_4">
				查询
			</button>
		</view> -->

		<view class="" style="margin-top: 74rpx;">
			<v-gap color="#EDF5F5" />
			<view class=""
				style="background-color: #ffffff;width: 94%;margin-left: 3%;margin-bottom: 20rpx;position: relative;"
				v-for="(item,index) in hylist " :key="index">
				<div class="d-flex flex-column" style="padding: 20rpx;">
					<view class="d-flex flex-row align-center justify-space-between">
						<view class="d-flex flex-row align-center">
							<view class="">
								<image style="width: 120rpx;height: 120rpx;" :src="item.coach_avatar" mode=""></image>
							</view>
							<view class="d-flex flex-column" style="margin-left: 20rpx;">
								<view class="" style="font-size: 26rpx;">
									{{item.full_name}}
									<text style="margin-left: 20rpx;" v-if="item.sex == 1">男</text>
									<text style="margin-left: 20rpx;" v-if="item.sex == 2">女</text>
								</view>
								<view class="" style="color: #c2c2c2;font-size: 24rpx;margin-top: 10rpx;">
									{{item.phone_num}}
								</view>
								<view class="" style="color: #c2c2c2;font-size: 24rpx;margin-top: 10rpx;">
									教龄 {{item.teach_age?item.teach_age:''}}年 | {{item.birthday?item.birthday:''}}
								</view>
							</view>
						</view>
						<view class="">
							<view class="" style="font-size: 24rpx;text-align: right;">
								{{item.name|| ''}}
							</view>
							<view class="" v-if="item.level_type_name"
								style="height: 40rpx;background: #ffffff;color: #7cc57e;font-size: 22rpx;text-align: center;line-height: 35rpx;border: 1rpx #7cc57e solid;border-radius: 40rpx;padding: 0px 15rpx;margin-top: 10rpx;">
								{{item.level_type_name?item.level_type_name:''}}
							</view>
						</view>
					</view>
					<view class="" style="margin-top: 20rpx;">
						<view class="d-flex flex-row justify-space-between align-center">
							<view class="d-flex flex-row align-center" style="font-size: 24rpx;">
								排序<input type="number" v-model="item.sort"
									style="width: 120rpx;border: #c2c2c2 1rpx solid;padding-left: 10rpx;margin-left: 10rpx;"
									@blur="saveSort(item.id, item.sort)" />
							</view>
							<view class="d-flex flex-row justify-center align-center">
								<view class="d-flex flex-row align-center justify-center">
									<u-checkbox-group placement="row" @change="(e) => checkboxChange1(e, item.id)"
										iconSize='13px' size='12px'>
										<u-checkbox label="线上" activeColor="#2F75FA" labelSize="12px"
											labelColor="#999999" :checked="item.is_applet == 1 ? true : false">
										</u-checkbox>
									</u-checkbox-group>
								</view>
								<view class="d-flex flex-row align-center justify-center"
									style="font-size: 24rpx;color: #999999;margin-left: 20rpx;">
									启用禁用<u-switch v-model="item.job_status" @change="(e) => checkboxChange2(e, item.id)"
										size="14" :active-value="1" :inactive-value="0" activeColor="#13ce66"
										inactiveColor="#ff0000"></u-switch>
								</view>
							</view>
						</view>
					</view>
					<view class="" style="margin-top: 20rpx;">
						<view class="d-flex flex-row justify-space-between align-center">
							<view class="" @click="showEnrollDetail(item)" style="font-size: 24rpx;">
								提成规则<text style="color: #0055ff;">{{item.venue_id}}</text> 条
							</view>
							<view class="d-flex flex-row justify-end">
								<view class="d-flex flex-row align-center justify-center" @click="onedit(item,index)"
									style="width: 150rpx;height: 50rpx;background: #ffffff;color: #ec652b;font-size: 24rpx;text-align: center;margin-right: 20rpx;line-height: 50rpx;border-radius: 10rpx;border: #ec652b  1rpx solid;">
									<!-- <image class="" style="width: 20rpx;height: 20rpx;"
										src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/7886aba3ece8aae3b489b1944b48572a4f092c41.png" /> -->
									<view class="" style="margin-left: 10rpx;font-size: 22rpx;">
										编辑
									</view>
								</view>
								<view class="d-flex flex-row align-center justify-center" @click="ondelete(item,index)"
									style="width: 150rpx;height: 50rpx;;background: linear-gradient(0deg, rgba(214, 53, 53, 0.9), rgba(255, 64, 64, 0.93), rgba(250, 142, 142, 0.93));color: #ffffff;font-size: 24rpx;text-align: center;margin-right: 20rpx;line-height: 50rpx;border-radius: 10rpx;">
									<!-- <image class="" style="width: 20rpx;height: 20rpx;"
										src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/fe85ef51643a187a6090a929b34e93738e12e365.png" /> -->
									<view class="" style="margin-left: 10rpx;font-size: 22rpx;">
										删除
									</view>
								</view>
							</view>
						</view>
					</view>
				</div>
			</view>
		</view>
		<view class="" style="width: 100%;height: 120rpx;"></view>
		<view class="d-flex flex-row justify-space-between justify-center align-center"
			style="position: fixed;bottom: 0;height: 120rpx;background-color: #fff;width: 100%;padding: 0 8%;z-index: 99;">
			<view class=""
				style="width: 45%;height: 80rpx;background: #ffffff;color: #ec652b;font-size: 24rpx;text-align: center;border-radius: 35rpx;line-height: 80rpx;border:#ec652b 1rpx solid">
				重置
			</view>
			<view class="" @click="addculum"
				style="width: 45%;height: 80rpx;background: linear-gradient(0deg, rgba(214, 53, 53, 0.9), rgba(255, 64, 64, 0.93), rgba(250, 142, 142, 0.93));
				border-radius: 80rpx 80rpx;color: #ffffff;font-size: 24rpx;text-align: center;border-radius: 35rpx;line-height: 80rpx;">
				新增
			</view>
		</view>

		<u-popup @touchmove.stop :show="enrollDetailPopup" @close="enrollDetailPopup = false" closeOnClickOverlay
			mode="center" :safeAreaInsetBottom="false" round="10">
			<view class="storepopup" style="height: 78vh;padding: 20rpx 20rpx;width: 660rpx;">
				<view class="title flex-between">
					<text>教练信息</text>
					<u-icon @click="enrollDetailPopup = false" name="close-circle-fill" color="#dde3e8"
						size="18"></u-icon>
				</view>
				<view class="enroll-detail-popup">
					<view class=""
						style="background-color: #ffffff;width: 94%;margin-left: 3%;margin-bottom: 20rpx;position: relative;">
						<view class="d-flex flex-column" style="padding: 20rpx;">
							<view class="d-flex flex-row align-center justify-space-between">
								<view class="d-flex flex-row align-center">
									<view class="">
										<image style="width: 120rpx;height: 120rpx;" :src="activitylist.coach_avatar"
											mode=""></image>
									</view>
									<view class="d-flex flex-column" style="margin-left: 20rpx;">
										<view class="" style="font-size: 26rpx;">
											{{activitylist.full_name}}
											<text style="margin-left: 20rpx;" v-if="activitylist.sex == 1">男</text>
											<text style="margin-left: 20rpx;" v-if="activitylist.sex == 2">女</text>
										</view>
										<view class="" style="color: #c2c2c2;font-size: 24rpx;margin-top: 10rpx;">
											{{activitylist.phone_num}}
										</view>
										<view class="" style="color: #c2c2c2;font-size: 24rpx;margin-top: 10rpx;">
											教龄 {{activitylist.teach_age?activitylist.teach_age:''}}年 |
											{{activitylist.birthday?activitylist.birthday:''}}
										</view>
									</view>
								</view>

								<view class="flex-column align-center">
									<view class="" style="font-size: 24rpx;">
										{{activitylist.name|| ''}}
									</view>
									<view class="" v-if="activitylist.level_type_name"
										style="height: 40rpx;background: #ffffff;color: #7cc57e;font-size: 22rpx;text-align: center;line-height: 35rpx;border: 1rpx #7cc57e solid;border-radius: 40rpx;padding: 0px 15rpx;margin-top: 10rpx;">
										{{activitylist.level_type_name?activitylist.level_type_name:''}}
									</view>
								</view>
							</view>
						</view>
					</view>

					<view class=""
						style="background-color: #f4f4f4;padding: 30rpx;border-radius: 10rpx;margin-top: 20rpx;font-size: 24rpx;">
						<!-- <view class="">
							实到学员名单{{studentlist.length}}人
						</view> -->
						<scroll-view @scrolltolower="loadMoreData" scroll-y style="height: 48vh; ">
							<view v-for="(item,index) in coachlist" :key="index"
								style="background-color: #ffffff;padding: 20rpx;border-radius: 10rpx;width: 100%;margin-bottom: 20rpx;font-size: 24rpx;display: flex; flex-direction: row; justify-content: space-between; align-items: center;">
								<view class="" style="display: flex; flex-direction: column;">
									<view class="" style="display: flex; flex-direction: row; align-items: center; ">
										<view class="">
											<image style="width: 50rpx;height: 50rpx;border-radius: 50% 50%;"
												:src="item.coach.coach_avatar" mode=""></image>
										</view>
										<view class=""
											style="display: flex; flex-direction: column;margin-left: 10rpx;">
											<view class="">
												{{item.coach.full_name}} <text
													:class="item.coach.sex == '1' ? 'text-blue' : 'text-red'">{{
											item.coach.sex == 1 ? '男' :'女'
										}}</text>
											</view>
											<view class="">
												{{item.coach.phone_num}}
											</view>
										</view>
									</view>

									<view class="" style="display: flex; flex-direction: row;">
										<view class="">
											{{item.venueproject.name}}
										</view>
										<view class="" style="margin-left: 20rpx;">
											{{item.area.venue_name}}
										</view>
									</view>
									<view class="">
										{{item.shoptrain.name}}
									</view>
									<view class="">
										<view v-for="(rate, idx) in item.calc_rules" :key="idx"
											class="text-sm text-right">
											{{ rate.min }}-{{ rate.max }}元: {{ rate.value }}%
										</view>
									</view>
								</view>
								<view class="d-flex flex-row align-center">
									<view class="" @click="toedit(item,index)">
										<image style="width: 30rpx;height: 30rpx;margin-right: 20rpx;"
											src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/7886aba3ece8aae3b489b1944b48572a4f092c41.png"
											mode="">
										</image>
									</view>
									<view class="" @click="todelete(item,index)">
										<image style="width: 30rpx;height: 30rpx;"
											src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/fe85ef51643a187a6090a929b34e93738e12e365.png"
											mode="">
										</image>
									</view>
								</view>
							</view>

						</scroll-view>

					</view>
				</view>
				<view class="" @click="torule()"
					style="width: 90%;height: 80rpx;background: linear-gradient(0deg, rgba(214, 53, 53, 0.9), rgba(255, 64, 64, 0.93), rgba(250, 142, 142, 0.93));
					border-radius: 80rpx 80rpx;color: #ffffff;font-size: 24rpx;text-align: center;border-radius: 35rpx;line-height: 80rpx;margin-top: 20rpx;margin-left: 5%;">
					添加规则
				</view>
			</view>
		</u-popup>

		<u-popup @touchmove.stop :show="rulePopup" @close="rulePopup = false" closeOnClickOverlay mode="center"
			:safeAreaInsetBottom="false" round="10">
			<view class="storepopup" style="height: 78vh;padding: 20rpx 20rpx;width: 660rpx;">
				<view class="title flex-between">
					<text>编辑规则</text>
					<u-icon @click="rulePopup = false" name="close-circle-fill" color="#dde3e8" size="18"></u-icon>
				</view>
				<view class="enroll-detail-popup">
					<view class=""
						style="background-color: #ffffff;width: 94%;margin-left: 3%;margin-bottom: 20rpx;position: relative;">
						<view class="d-flex flex-column" style="padding: 20rpx;">
							<view class="d-flex flex-row align-center justify-space-between">
								<view class="d-flex flex-row align-center">
									<view class="">
										<image style="width: 120rpx;height: 120rpx;" :src="activitylist.coach_avatar"
											mode=""></image>
									</view>
									<view class="d-flex flex-column" style="margin-left: 20rpx;">
										<view class="" style="font-size: 26rpx;">
											{{activitylist.full_name}}
											<text style="margin-left: 20rpx;" v-if="activitylist.sex == 1">男</text>
											<text style="margin-left: 20rpx;" v-if="activitylist.sex == 2">女</text>
										</view>
										<view class="" style="color: #c2c2c2;font-size: 24rpx;margin-top: 10rpx;">
											{{activitylist.phone_num}}
										</view>
										<view class="" style="color: #c2c2c2;font-size: 24rpx;margin-top: 10rpx;">
											教龄 {{activitylist.teach_age?activitylist.teach_age:''}}年 | 男
											{{activitylist.birthday?activitylist.birthday:''}}
										</view>
									</view>
								</view>

								<view class="">
									<view class="" style="font-size: 24rpx;text-align: right;">
										{{activitylist.name|| ''}}
									</view>
									<view class="" v-if="activitylist.level_type_name"
										style="height: 40rpx;background: #ffffff;color: #7cc57e;font-size: 22rpx;text-align: center;line-height: 35rpx;border: 1rpx #7cc57e solid;border-radius: 40rpx;padding: 0px 15rpx;margin-top: 10rpx;">
										{{activitylist.level_type_name?activitylist.level_type_name:''}}
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class=""
						style="background-color: #f4f4f4;padding: 30rpx 10rpx;border-radius: 10rpx;margin-top: 20rpx;font-size: 24rpx;">
						<view class="">
							提成比例档
							请分档创建提成比例，注意开始和结束数值不能重复
						</view>
						<view
							style="background-color: #ffffff;padding: 20rpx;border-radius: 10rpx;width: 100%;margin-top: 20rpx;font-size: 24rpx;display: flex; flex-direction: row; justify-content: space-between; align-items: center;height: 100rpx; ">
							<view class="">
								起始金额区间
							</view>
							<view class="" style="margin-left: 10rpx;">
								结束金额区间
							</view>
							<view class="" style="margin-left: 10rpx;">
								提成比例 (%)
							</view>
							<view class="close" style="margin-left: 10rpx;">
								操作
							</view>
						</view>
						<scroll-view scroll-y style="height: 32vh; ">
							<view v-for="(item,index) in subTineList" :key="index"
								style="background-color: #ffffff;padding: 20rpx;border-radius: 10rpx;width: 100%;margin-top: 20rpx;font-size: 24rpx;display: flex; flex-direction: row; justify-content: space-between; align-items: center;height: 100rpx; ">
								<view class="" style="border: #c2c2c2 1rpx solid;font-size: 20rpx;padding-left: 10rpx;">
									<input type="number" v-model="item.min" />
								</view>
								<view class=""
									style="border: #c2c2c2 1rpx solid;font-size: 20rpx;margin-left: 10rpx;padding-left: 10rpx;">
									<input type="number" v-model="item.max" />
								</view>
								<view class=""
									style="border: #c2c2c2 1rpx solid;font-size: 20rpx;margin-left: 10rpx;padding-left: 10rpx;">
									<input type="number" v-model="item.value" />
								</view>
								<view class="close" @click="removeSubTime(index)" style="margin-left: 10rpx;">
									<van-icon name="cross" size="34rpx" color="rgb(153,153,153)" />
								</view>
							</view>
						</scroll-view>
						<view class="add flex-center">
							<van-icon @click='addSubTime' name="add-o" size="56rpx" color="#6b65f7" />
						</view>
					</view>
				</view>
				<view class="" @click="addrule()"
					style="width: 90%;height: 80rpx;background: linear-gradient(0deg, rgba(214, 53, 53, 0.9), rgba(255, 64, 64, 0.93), rgba(250, 142, 142, 0.93));
					border-radius: 80rpx 80rpx;color: #ffffff;font-size: 24rpx;text-align: center;border-radius: 35rpx;line-height: 80rpx;margin-top: 20rpx;margin-left: 5%;">
					保存
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	const venues = require("@/api/venues/venues.js");
	const lastdata = [{
		"name": '筛选',
		"type": 'filter',
		"submenu": [{
				"name": "性别",
				"submenu": [{
						"name": "男",
						"value": "1"
					},
					{
						"name": "女",
						"value": "2"
					}
				]
			},
			{
				"name": "机构",
				"submenu": [{
						"name": "总部",
						"value": "1"
					},
					{
						"name": "分布A",
						"value": "2"
					},
					{
						"name": "分布B",
						"value": "3"
					}
				]
			},
			{
				"name": "转态",
				"submenu": [{
						"name": "在读",
						"value": "4"
					},
					{
						"name": "休学",
						"value": "5"
					},
					{
						"name": "结业",
						"value": "6"
					}
				]
			},
			{
				"name": "年龄",
				"submenu": [{
						"name": "6-8岁",
						"value": "4"
					},
					{
						"name": "9-12岁",
						"value": "5"
					},
					{
						"name": "13-15岁",
						"value": "6"
					}
				]
			}
		]
	}];
	export default {
		data() {
			return {
				showoccupation: false, //职业
				occupation_status: [], //职业
				occupation_list: [{
						id: 1,
						label: "充值卡"
					},
					{
						id: 2,
						label: "10次卡"
					},
					{
						id: 3,
						label: "20次卡"
					},
					{
						id: 4,
						label: "30次卡"
					},
					{
						id: 5,
						label: "40次卡"
					},
				],
				userInfo: {
					occupation_relation: '',
					occupation_relation_id: '',
				},
				shows0: -1,
				filterData: [],
				itemChooselist: {},
				venuelist: [],
				listQuery: { //分页
					pageNo: 1,
					pageSize: 6,
				},
				totalPage: '', //几页
				studentlist: [],
				searchKey: "",
				hylist: [],
				venue_id: '',
				enrollDetailPopup: false,
				activitylist: {},
				subTineList: [ //预约时间段
					{
						min: 0, //人数
						max: 0, //人数
						value: 0, //人数
					}
				],
				rulePopup: false,
				coachlist: [],
				listQuery1: { //分页
					pageNo1: 1,
					pageSize1: 6,
				},
				totalPage1: '', //几页
				calc_rules: [],
				commissionList: {},
				venue_name: ''
			}
		},
		onLoad() {
			var data = uni.getStorageSync("wqzdy");
			var items = JSON.parse(data)
			this.venuelist = items
			// this.itemChooselist = this.venuelist[0]
			// 处理itemChooselist的逻辑
			if (this.venuelist.length > 0) {
				this.itemChooselist = this.venuelist[0]
				this.venue_id = this.venuelist[0].id
				this.venue_name = this.venuelist[0].venue_name
			} else {
				this.itemChooselist = {}; // 或者设置为其他默认值
			}
			setTimeout(() => {
				this.filterData = lastdata;
			}, 100);
			this.shuju()
		},
		onShow() {
			this.coachindex()
		},
		methods: {
			checkboxChange2(e, activityId) {
				console.log('change', e, activityId);
				this.coachstatus(e, activityId)
			},
			checkboxChange1(e, activityId) {
				console.log(e, 'e');
				if (e.length === 0) {
					this.read_checked1 = 2;
				} else {
					this.read_checked1 = 1;
				}
				this.coltitie = 'is_applet';
				this.activityid = activityId; // 保存拿到的activity.id
				console.log(this.read_checked1, 'this.read_checked1');
				this.coachstatus();
			},
			async saveSort(id, sort) {
				let that = this;
				let params = {
					id: id,
					sort: sort
				}
				let res = await venues.coachsort(params)
				if (res.code === 1) {
					this.listQuery.pageNo = 1
					that.hylist = []
					this.coachindex()
				}
			},
			async coachstatus(e, activityId) {
				let that = this;
				let params = {
					id: activityId,
					sort: e
				}
				let res = await venues.coachstatus(params)
				if (res.code === 1) {
					this.listQuery.pageNo = 1
					that.hylist = []
					this.coachindex()
				}
			},
			todelete(item, index) {
				let that = this
				uni.showModal({
					title: '提示',
					// 提示文字
					content: '是否删除课程类型',
					// 取消按钮的文字自定义
					cancelText: "取消",
					// 确认按钮的文字自定义
					confirmText: "确定",
					//删除字体的颜色 
					confirmColor: '#000000',
					//取消字体的颜色
					cancelColor: '#999',
					success: function(res) {
						if (res.confirm) {
							let params = {
								ids: item.id,
							};
							venues.commissiondel(params).then(res => {
								if (res.code == 1) {
									that.CoachCommission()
								}
							})
						} else {}
					}
				})
			},
			async addrule() {
				let that = this;
				let params = {
					ids: this.commissionList.id,
					row: {
						area_id: this.commissionList.area_id,
						calc_rules: this.subTineList,
						coach_ids: this.commissionList.coach_id,
						course_ids: this.commissionList.course_ids,
						id: this.commissionList.id,
						train_ids: this.commissionList.train_ids,
						venue_id: this.commissionList.venue_id,
						venue_project_id: this.commissionList.venue_project_id,
					}
				}
				let res = await venues.commissionedit(params)
				if (res.code === 1) {
					this.rulePopup = false
				}
			},
			async CoachCommission() {
				let that = this;
				if (this.listQuery1.pageNo1 === 1) that.coachlist = [];
				let params = {
					filter: {
						"coach_id": this.activitylist.id,
						"coach_commission_rules.venue_id": this.venue_id,
					},
					pageSize: this.listQuery1.pageSize1,
					page: this.listQuery1.pageNo1,
					op: {
						"coach.full_name": "=",
						"coach_commission_rules.venue_id": "=",
						"area_id": "=",
						"venue_project_id": "=",
						"coach_id": "=",
						"train_id": "="
					}
				}
				let res = await venues.CoachCommission(params)
				if (res.code === 1) {
					// this.hylist = res.data.list.data
					that.coachlist = that.coachlist.concat(res.data.data); //将数据拼接在一起
					that.totalPage1 = res.data.last_page
				}
			},
			loadMoreData() {
				if (this.totalPage1 <= this.listQuery1.pageNo1) {
					uni.showToast({
						title: '没有更多了',
						duration: 2000,
						icon: 'none'
					});
					return
				}
				this.listQuery1.pageNo1 += 1;
				this.CoachCommission()
			},
			toedit(item) {
				this.rulePopup = true
				this.subTineList = item.calc_rules
				this.commissionList = item
			},
			torule() {
				uni.navigateTo({
					url: './rule?venue_id=' + this.venue_id + "&full_name=" + this.activitylist.full_name +
						"&coach_id=" + this.activitylist.id + "&venue_name=" + this.venue_name
				})
			},
			//新增
			addSubTime() {
				this.subTineList.push({
					min: 0, //人数
					max: 0, //人数
					value: 0, //人数
				})
			},
			//删除
			removeSubTime(indexs) {
				this.subTineList = this.subTineList.filter((item, index) => {
					return index !== indexs
				})
			},
			closehomeInfo() {
				this.enrollDetailPopup = false
			},
			showEnrollDetail(item) {
				this.coachlist = []
				this.enrollDetailPopup = true
				this.activitylist = item
				this.CoachCommission()
			},
			async coachindex() {
				let that = this;
				if (this.listQuery.pageNo === 1) that.hylist = [];
				let params = {
					keyword: this.searchKey,
					pageSize: this.listQuery.pageSize,
					page: this.listQuery.pageNo,
					venue_id: this.venue_id,
				}
				let res = await venues.coachindex(params)
				if (res.code === 1) {
					// this.hylist = res.data.list.data
					that.hylist = that.hylist.concat(res.data.list.data); //将数据拼接在一起
					that.totalPage = res.data.list.last_page
				}
			},
			// 下拉刷新
			onReachBottom() {
				if (this.totalPage <= this.listQuery.pageNo) {
					uni.showToast({
						title: '没有更多了',
						duration: 2000,
						icon: 'none'
					});
					return
				}
				this.listQuery.pageNo += 1;
				this.coachindex()
			},
			search(e) {
				this.listQuery.pageNo = 1
				this.searchKey = e
				this.coachindex()
			},
			addculum() {
				uni.navigateTo({
					url: '../coachdetail/index?venue_id=' + this.venue_id + "&status=" + 2
				})
			},
			onedit(item, index) {
				uni.navigateTo({
					url: `../coachdetail/index?selectionArr=${encodeURIComponent(JSON.stringify(item))}` +
						"&status=" + 1 + "&venue_id=" + this.venue_id
				})
			},
			ondelete(item, index) {
				let that = this
				uni.showModal({
					title: '提示',
					// 提示文字
					content: '是否删除！',
					// 取消按钮的文字自定义
					cancelText: "取消",
					// 确认按钮的文字自定义
					confirmText: "确定",
					//删除字体的颜色 
					confirmColor: '#000000',
					//取消字体的颜色
					cancelColor: '#999',
					success: function(res) {
						if (res.confirm) {
							let params = {
								id: item.id
							};
							venues.coachdel(params).then(res => {
								if (res.code == 1) {
									uni.$u.toast(res.info);
									setTimeout(() => {
										that.coachindex()
									}, 1000)
								}
							})
						} else {}
					}
				})
			},
			confirm1(data) {
				this.venue_id = data
				console.log(data, 'data');
				// 直接根据接收到的 id 在 venuelist 中查找对应的场馆对象
				const selectedItem = this.venuelist.find(item => item.id === data);
				if (selectedItem) {
					// 将找到的场馆对象赋值给 itemChooselist
					this.itemChooselist = selectedItem;
				} else {
					console.log(`未找到 id 为 ${data} 的场馆对象`);
				}
				console.log(this.itemChooselist)
				this.venue_name = this.itemChooselist.venue_name
				this.coachindex()
			},
			confirm(e) {
				// this.indexArr = e.index;
				// this.valueArr = e.value;

			},
			showsclick(item, index) {
				this.shows0 = index
			},
			tomember() {
				uni.navigateTo({
					url: '../membershipdetail/index'
				})
			},

			shuju() {
				this.occupation_status.push(
					this.occupation_list
				)
			},
			// 职业
			addoccupation(e) {
				this.userInfo.occupation_relation = e.value[0].label
				this.userInfo.occupation_relation_id = e.value[0].id
				this.showoccupation = false
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		width: 100%;
		min-height: 100vh;
		background-color: #EDF5F5;
		position: relative;

		.box_11 {
			width: 100%;
			height: 130rpx;
			display: flex;
			flex-direction: row;
			background: #ffffff;
			padding: 0 20rpx;

			// .image-wrapper_7 {
			// 	width: 541rpx;
			// 	height: 60rpx;
			// 	flex-direction: row;
			// 	display: flex;
			// 	margin-top: 15rpx;
			// }
			.image-wrapper_7 {
				position: absolute;
				left: 30rpx;
				top: 30rpx;
				width: 541rpx;
				height: 62rpx;
				flex-direction: row;
				display: flex;
			}

			.label_list {
				display: flex;
				flex-direction: column;
				position: absolute;
				justify-content: center;
				/* 相对父元素水平居中 */
				align-items: center;
				/*  子元素相对父元素垂直居中 */
				right: 90rpx;
				width: 80rpx;
				top: 27rpx;

				.label_7 {
					width: 36rpx;
					height: 36rpx;
				}

				.label_77 {
					width: 60rpx;
					height: 36rpx;
					color: #333333;
					font-size: 26rpx;
					text-align: center;
				}
			}

			.label8_list {
				display: flex;
				flex-direction: column;
				position: absolute;
				justify-content: center;
				/* 相对父元素水平居中 */
				align-items: center;
				/*  子元素相对父元素垂直居中 */
				right: 20rpx;
				width: 80rpx;
				top: 27rpx;

				.label_8 {
					width: 36rpx;
					height: 36rpx;
				}

				.label_88 {
					width: 60rpx;
					height: 36rpx;
					color: #333333;
					font-size: 26rpx;
					text-align: center;
				}
			}
		}

		.group_3 {
			background-color: rgb(255, 255, 255);
			width: 710rpx;
			// height: 100%;
			display: flex;
			flex-direction: column;
			margin: 0 0 0 20rpx;
			position: fixed;
			z-index: 99;
			top: 249rpx;


			.item {
				// padding: 29rpx 30rpx 30rpx;
				padding: 20rpx 30rpx 20rpx 30rpx;

				.atinput {
					// border: #EBECEE 1rpx solid;
					font-size: 24rpx;
					height: 60rpx;
					width: 650rpx;
					padding-left: 20rpx;
				}

				.item-title {
					color: rgb(153, 153, 153);
					font-size: 28rpx;
					font-weight: 500;
					margin-bottom: 20rpx;
				}

				.value {
					color: rgb(51, 51, 51);
					font-size: 28rpx;
					font-weight: 500;
				}

				.time-cell {
					color: rgb(51, 51, 51);
					font-size: 28rpx;
					font-weight: 500;
					justify-content: flex-start;

					.time {
						width: 49%;

						&:last-of-type {
							margin-left: 20rpx;
						}
					}
				}

				.week-list {
					display: grid;
					grid-template-columns: repeat(5, 1fr);
					grid-gap: 20rpx;
					position: relative;

					.week-item {
						padding: 15rpx 0;
						background-color: rgb(243, 243, 243);
						border-radius: 5rpx;
						text-align: center;
						color: rgb(51, 51, 51);
						font-size: 24rpx;
						font-weight: 500;
						border: solid 2rpx transparent;
						box-sizing: border-box;
					}

					.active {
						color: rgba(255, 98, 0, 1);
						background-color: rgba(255, 65, 5, 0.1);
						// border: solid 2rpx rgb(99, 93, 247);
						position: relative;

						// &:before {
						// 	display: block;
						// 	content: '';
						// 	position: absolute;
						// 	width: 27rpx;
						// 	height: 28rpx;
						// 	right: -2rpx;
						// 	bottom: -2rpx;
						// 	background-image: url("https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/46b1cc85fcb0fd76095daf823b7d2bb4a3235519.png");
						// 	background-repeat: no-repeat;
						// 	background-size: 100%;
						// }
					}

					.active1 {
						color: rgba(255, 98, 0, 1);
						background-color: rgba(255, 65, 5, 0.1);
						// border: solid 2rpx rgb(99, 93, 247);
						position: relative;
					}

					.active2 {
						color: rgba(255, 98, 0, 1);
						background-color: rgba(255, 65, 5, 0.1);
						// border: solid 2rpx rgb(99, 93, 247);
						position: relative;
					}

					.check {
						color: rgb(51, 51, 51);
						font-size: 24rpx;
						position: absolute;
						bottom: 10rpx;
						right: 0;
					}
				}
			}
		}

		.text_2 {
			width: 93rpx;
			height: 23rpx;
			overflow-wrap: break-word;
			color: rgba(136, 136, 136, 1);
			font-size: 24rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 15rpx 0 0 21rpx;
		}

		.section_2 {
			background-color: rgba(229, 229, 229, 1.000000);
			width: 672rpx;
			height: 1rpx;
			display: flex;
			flex-direction: column;
			margin: 40rpx 0 0 18rpx;
		}

		.text_3 {
			width: 47rpx;
			height: 23rpx;
			overflow-wrap: break-word;
			color: rgba(136, 136, 136, 1);
			font-size: 24rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 42rpx 0 0 19rpx;
		}

		.text_4 {
			width: 82rpx;
			height: 26rpx;
			overflow-wrap: break-word;
			color: rgba(51, 51, 51, 1);
			font-size: 28rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 24rpx 0 0 20rpx;
		}

		.section_3 {
			background-color: rgba(229, 229, 229, 1.000000);
			width: 672rpx;
			height: 1rpx;
			display: flex;
			flex-direction: column;
			margin: 40rpx 0 0 18rpx;
		}

		.text_5 {
			width: 47rpx;
			height: 23rpx;
			overflow-wrap: break-word;
			color: rgba(136, 136, 136, 1);
			font-size: 24rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 39rpx 0 0 19rpx;
		}

		.text_6 {
			width: 82rpx;
			height: 26rpx;
			overflow-wrap: break-word;
			color: rgba(51, 51, 51, 1);
			font-size: 28rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 24rpx 0 0 20rpx;
		}

		.section_4 {
			background-color: rgba(229, 229, 229, 1.000000);
			width: 672rpx;
			height: 1rpx;
			display: flex;
			flex-direction: column;
			margin: 40rpx 0 0 18rpx;
		}

		.text_7 {
			width: 95rpx;
			height: 23rpx;
			overflow-wrap: break-word;
			color: rgba(136, 136, 136, 1);
			font-size: 24rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 39rpx 0 0 19rpx;
		}

		.image_2 {
			width: 151rpx;
			height: 151rpx;
			margin: 25rpx 0 0 18rpx;
		}


		.text_8 {
			width: 95rpx;
			height: 23rpx;
			overflow-wrap: break-word;
			color: rgba(136, 136, 136, 1);
			font-size: 24rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 20rpx 0 0 19rpx;
		}

		.section_6 {
			width: 378rpx;
			height: 62rpx;
			flex-direction: row;
			display: flex;
			justify-content: space-between;
			margin: 26rpx 0 27rpx 21rpx;
		}

		.button_1 {
			background-color: rgba(243, 243, 243, 1.000000);
			height: 62rpx;
			display: flex;
			flex-direction: column;
			width: 174rpx;
		}

		.text_9 {
			width: 48rpx;
			height: 24rpx;
			overflow-wrap: break-word;
			color: rgba(51, 51, 51, 1);
			font-size: 24rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 19rpx 0 0 63rpx;
		}

		.button_2 {
			background-color: rgba(255, 65, 5, 0.100000);
			height: 62rpx;
			display: flex;
			flex-direction: column;
			width: 174rpx;
		}

		.text_10 {
			width: 73rpx;
			height: 24rpx;
			overflow-wrap: break-word;
			color: rgba(255, 98, 0, 1);
			font-size: 24rpx;
			font-family: PingFang-SC-Medium;
			font-weight: 500;
			text-align: left;
			white-space: nowrap;
			line-height: 34rpx;
			margin: 19rpx 0 0 51rpx;
		}

		.button_4 {
			width: 90%;
			height: 70rpx;
			background: #3dabff;
			border-radius: 10rpx;
			margin-left: 5%;
			color: #fff;
			font-size: 28rpx;
			z-index: 999;
			line-height: 70rpx;
			margin-bottom: 20rpx;
		}

		.button_3 {
			width: 90%;
			height: 80rpx;
			position: fixed;
			bottom: 20rpx;
			background: linear-gradient(0deg, rgba(214, 53, 53, 0.9), rgba(255, 64, 64, 0.93), rgba(250, 142, 142, 0.93));
			border-radius: 80rpx 80rpx;
			margin-left: 5%;
			color: #fff;
			font-size: 28rpx;
			z-index: 999;
		}

		.box_20 {
			background-color: rgba(0, 0, 0, 1);
			border-radius: 10rpx;
			position: absolute;
			width: 165rpx;
			height: 105rpx;
			flex-direction: row;
			display: flex;
			right: 35rpx;
			top: 100rpx;
			z-index: 998;

			.image-text_4 {
				width: 34rpx;
				height: 62rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				margin: 20rpx 0 0 28rpx;
			}

			.icon_5 {
				width: 30rpx;
				height: 30rpx;
				margin-left: 2rpx;
			}

			.text-group_4 {
				width: 34rpx;
				height: 18rpx;
				overflow-wrap: break-word;
				color: rgba(255, 255, 255, 1);
				font-size: 18rpx;
				font-family: PingFang-SC-Medium;
				font-weight: 500;
				text-align: left;
				white-space: nowrap;
				line-height: 24rpx;
				margin-top: 14rpx;
			}

			.image-text_5 {
				width: 36rpx;
				height: 65rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				margin: 17rpx 0 0 37rpx;
			}

			.icon_67 {
				width: 32rpx;
				height: 32rpx;
				margin-left: 2rpx;
			}

			.text-group_5 {
				width: 36rpx;
				height: 18rpx;
				overflow-wrap: break-word;
				color: rgba(255, 255, 255, 1);
				font-size: 18rpx;
				font-family: PingFang-SC-Medium;
				font-weight: 500;
				text-align: left;
				white-space: nowrap;
				line-height: 24rpx;
				margin-top: 15rpx;
			}

			.image-text_6 {
				width: 36rpx;
				height: 65rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				margin: 18rpx 0 0 37rpx;
			}

			.icon_7 {
				width: 32rpx;
				height: 32rpx;
				margin-left: 2rpx;
			}

			.text-group_6 {
				width: 36rpx;
				height: 18rpx;
				overflow-wrap: break-word;
				color: rgba(255, 255, 255, 1);
				font-size: 18rpx;
				font-family: PingFang-SC-Medium;
				font-weight: 500;
				text-align: left;
				white-space: nowrap;
				line-height: 24rpx;
				margin-top: 15rpx;
			}

			.image_4 {
				position: absolute;
				left: 125rpx;
				top: -13rpx;
				width: 28rpx;
				height: 14rpx;
			}
		}

		.text-blue {
			color: blue;
			margin-left: 10rpx;
		}

		.text-red {
			color: red;
			margin-left: 10rpx;
		}
	}
</style>